import random

from 课堂练习2 import guess_num

num = random.randint(1,10)
guess_num == int(input("请输入你要猜的数字"))
if guess_num == num:
    print("恭喜，你猜对了")
else:
    if guess_num > num:
        print("你猜测的数字太大了")
    else:
        print("你猜测的数字小了")
    guess_num == int(input("请再次输入你要猜的数字"))
    if guess_num == num:
            print("恭喜，你第二次猜对了")
    else:
        if guess_num > num:
                print("你猜测的数字大了")
        else:
             print("你猜测的数字太小了")
        guess_num == int(input("请第三次输入你要猜的数字"))
        if guess_num == num:
             print("恭喜，第三次猜中了")
        else:
             print(f"三次机会用完了，没有猜中%d"%(num))
